import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/about',
		name: 'about',
		component: () => import('../views/About.vue'),
		children: [{
			path: 'foo',
			component: () => import('../components/HelloWorld.vue')
		}]
	},
	{
		path: '/user',
		name: 'user',
		component: () => import('../views/About.vue'),
		children: [{
				path: 'admin',
				component: () => import('../views/user/admin.vue')
			},
			{
				path: 'normal',
				component: () => import('../views/user/normalUser.vue')
			},
			{
				path: 'admin/edit',
				component: () => import('../views/user/adminEdit.vue')
			},
			{
				path: 'normal/edit',
				component: () => import('../views/user/normalUserEdit.vue')
			}
		]
	},
	{
		path: '/question',
		name: 'question',
		component: () => import('../views/About.vue'),
		children: [{
				path: 'subject',
				component: () => import('../views/question/subject.vue')
			},
			{
				path: 'subject/quest',
				component: () => import('../views/question/allQuestion.vue')
			},
			{
				path: 'add/single',
				component: () => import('../views/question/addQuestion/singleQuestion.vue')
			},
			{
				path: 'add/multiply',
				component: () => import('../views/question/addQuestion/multiplyQuestion.vue')
			},
			{
				path: 'add/short',
				component: () => import('../views/question/addQuestion/shortAnswer.vue')
			}

		]
	},
	{
		path: '/paper',
		name: 'paper',
		component: () => import('../views/About.vue'),
		children: [{
				path: 'list',
				component: () => import('../views/exam/paper.vue')
			},
			{
				path: 'list/edit',
				component: () => import('../views/exam/paperGenerator.vue')
			},
			{
				path:'manual',
				component:()=>import('../views/exam/manualGenerator.vue')
			},
			{
				path:'auto',
				component:()=>import('../views/exam/autoGenerator.vue')
			}
		]
	},
	{
		path: '/',
		name: 'admin-login',
		component: () => import('../views/login.vue')
	}
]

const router = new VueRouter({
	routes
})

export default router
